/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */



package Presentacion;

/**
 *
 * @author Analia
 */
public class FrameEnviarCorreo extends javax.swing.JFrame
{

    private FramePrincipal frmPrincipalAux;

    /** Creates new form FrameEnviarCorreo */
    public FrameEnviarCorreo(FramePrincipal frmPrincipal)
    {

        this.frmPrincipalAux = frmPrincipal;
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        BotonEnviar = new javax.swing.JButton();
        BotonVolver = new javax.swing.JButton();
        LabelTitulo = new javax.swing.JLabel();
        LabelDe = new javax.swing.JLabel();
        LabelPara = new javax.swing.JLabel();
        LabelAsunto = new javax.swing.JLabel();
        EditDe = new javax.swing.JTextField();
        EditPara = new javax.swing.JTextField();
        EditAsunto = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        TextArea = new javax.swing.JTextArea();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        BotonEnviar.setText("Enviar");
        BotonEnviar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotonEnviarActionPerformed(evt);
            }
        });

        BotonVolver.setText("Volver");
        BotonVolver.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotonVolverActionPerformed(evt);
            }
        });

        LabelTitulo.setFont(new java.awt.Font("DejaVu Sans", 1, 13));
        LabelTitulo.setText("ENVIAR CORREO");

        LabelDe.setText("De");

        LabelPara.setText("Para");

        LabelAsunto.setText("Asunto");

        EditDe.setText("@hotmail.com");

        EditPara.setText("grupo14sa@virtual.fcet.uagrm.edu.bo");
        EditPara.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                EditParaActionPerformed(evt);
            }
        });

        TextArea.setColumns(20);
        TextArea.setRows(5);
        jScrollPane1.setViewportView(TextArea);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(117, 117, 117)
                .addComponent(BotonEnviar)
                .addGap(35, 35, 35)
                .addComponent(BotonVolver)
                .addGap(178, 178, 178))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(115, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(LabelAsunto)
                    .addComponent(LabelDe)
                    .addComponent(LabelPara))
                .addGap(28, 28, 28)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(EditDe)
                    .addComponent(EditAsunto)
                    .addComponent(EditPara, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(22, 22, 22))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(181, Short.MAX_VALUE)
                .addComponent(LabelTitulo)
                .addGap(168, 168, 168))
            .addGroup(layout.createSequentialGroup()
                .addGap(35, 35, 35)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 357, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(64, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(LabelTitulo)
                .addGap(27, 27, 27)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(LabelDe)
                    .addComponent(EditDe, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(12, 12, 12)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(EditPara, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(LabelPara))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(LabelAsunto)
                    .addComponent(EditAsunto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 112, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(BotonVolver)
                    .addComponent(BotonEnviar))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void BotonEnviarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotonEnviarActionPerformed

        frmPrincipalAux.Enviar(EditDe.getText(),EditPara.getText(),EditAsunto.getText(),TextArea.getText());

    }//GEN-LAST:event_BotonEnviarActionPerformed

    private void BotonVolverActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotonVolverActionPerformed

        frmPrincipalAux.setVisible(true);
        this.setVisible(false);
        frmPrincipalAux.quitEnviar();
}//GEN-LAST:event_BotonVolverActionPerformed

    private void EditParaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EditParaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_EditParaActionPerformed

    /**
    * @param args the command line arguments
    */
 /*   public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new FrameEnviarCorreo().setVisible(true);
            }
        });
    }*/

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BotonEnviar;
    private javax.swing.JButton BotonVolver;
    private javax.swing.JTextField EditAsunto;
    private javax.swing.JTextField EditDe;
    private javax.swing.JTextField EditPara;
    private javax.swing.JLabel LabelAsunto;
    private javax.swing.JLabel LabelDe;
    private javax.swing.JLabel LabelPara;
    private javax.swing.JLabel LabelTitulo;
    private javax.swing.JTextArea TextArea;
    private javax.swing.JScrollPane jScrollPane1;
    // End of variables declaration//GEN-END:variables

}
